﻿using NATS.Client.Core;

namespace Acl.Messages.Impl
{
    internal static class SubscribeOptionsExtensions
    {
        public static (NatsSubOpts?,string?) ToNatsSubOpts(this DistributionSubscribeOptions? ops)
        {
            if (ops is null) return default;

            var item = ops.Value;

            // NATS.Client.Core.NatsSubChannelOpts? channelOpts = default; TODO:

            return (new NatsSubOpts
            {
                MaxMsgs = item.MaxMsgs,
                Timeout = item.Timeout,
                StartUpTimeout = item.StartUpTimeout,
                IdleTimeout = item.IdleTimeout,
            },item.QueueGroup);
        }
    }
}